<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            padding: 0;
            margin: 0;
            border: 0;
            box-sizing: border-box;
        }
        .box {
            display: flex;
            min-width: 400px;
            max-width: 800px;
            justify-content: flex-end;
        }
        .avatar {
            width: 48px;
            height: 48px;
            border-radius: 50%;
            background-color: #00aeec;
            margin-right: 20px;
        }
        input {
            width: 220px;
            height: 48px;
            padding-left: 8px;
            background: #f5f5f5;
            border: 1px solid gray;
            border-radius: 4px;
            flex: 1;
            resize: none;
            outline: none;
            transition: all 1s;
        }
        input:focus {
            height: 70px;
            border-color: #e4e4e4;
            background: #fff;
        }
        .blue_border {
            border: 1px solid #00aeec;
        }
        button {
            width: 70px;
            margin-left: 10px;
            color: white;
            cursor: pointer;
            border: 1px;
            border-radius: 5px;
            background-color: #00aeec;
        }
        .box h3 {
            opacity: 0;
            margin-top: 5px;
            margin-right: 80px;
            font-size: 8px;
            color: gray;
            transition: all 0.5s;
        }
    </style>
</head>
<body>
    <div class="box">
        <i class="avatar"></i>
        <input type="text" placeholder="请输入内容">
        <button>发布</button>
    </div>
    <div class="box">
        <h3>0/200字</h3>
    </div>
    <script>
        
        const h3 = document.querySelector('.box h3')
        const input = document.querySelector('input')
        input.addEventListener('mouseenter', function(e){
            e.target.classList.add('blue_border')
        })
        
        input.addEventListener('mouseleave', function(e){
            e.target.classList.remove('blue_border')
        })
        input.addEventListener('focus', function(){
            h3.style.opacity = 1
        })
        input.addEventListener('blur', function(){
            h3.style.opacity = 0
        })
        input.addEventListener('input', function(e){
            const content = e.target.value
            h3.innerHTML = `${content.length}/200字`
        })
    </script>
</body>
</html>